<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<link rel="stylesheet" type="text/css" href="../css/templet.css" />
		<link rel="stylesheet" type="text/css" href="../fonts/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="../mui/css/mui.css" />
		<link rel="stylesheet" type="text/css" href="../ali/iconfont.css" />
		<!--公共js-->
		<script type="text/javascript" src="../common/js/jquery.js"></script>
		
		<!--插件-->
		<script type="text/javascript" src="../common/js/vue.min.js"></script>
		<script type="text/javascript" src="../common/js/mui.min.js"></script>
		
		<script type="text/javascript" src="../common/js/common.js"></script>
		<script type="text/javascript" src="../common/js/my_common.js"></script>
		<script type="text/javascript" src="../common/js/main.js"></script>
		<script type="text/javascript" src="../common/js/app.js"></script>
	</head>

	<body>
		<div id="app" v-cloak>
			<div v-if="clock_v">
				<div v-if="wind_work=='1'" class="wrap_body  bg-grayf4 work">
					<!--上半部分-->
					<div class="top">

						<!--红色部分-->
						<div class="bg-red9 pad-l-10 pad-r-10 pad-t-15">

							<!--logo部分-->
							<div class="fiex fff  pad-b-15">
								<!--左边-->
								<div class="fiex1 fiex">
									<!--logo-->
									<div class="mag-r-15">
										<img v-if="my_msg.headimgurl_path!=undefined" :src="oss+my_msg.headimgurl_path" class="logo_img" />
										<img v-else :src="con_img" class="logo_img" />
									</div>
									<!--店铺信息-->
									<div class="fiex1">
										<p class="f-20 f-b">{{my_msg.nickname}}</p>
										<p class="f-15 pad-t-5"><span>{{b_lg[1214]}}：</span><span>{{work_time}}</span></p>
									</div>
								</div>
								<!--右边下班部分-->
								<a @click="jum('../shop/offDuty.html')">
									<p class="center"><img src="../images/w/off_duty_white.png" class="off_duty_img" /></p>
									<p class="center pad-t-5 f-13 fff">{{b_lg[1215]}}</p>
								</a>
							</div>

							<!--顾客桌号部分-->
							<div>
								<!--有消息时-->
								<div class="info hide">
									<div>
										<div class="list table">
											<dl class="cf">
												<dt class="fl f-b f-15"><span class="red9 pad-r-5">002号</span><span>餐桌客人</span></dt>
												<dd class="fr f-13 grayb8">00:00</dd>
											</dl>
											<p class="mag-t-10 f-15 cf">
												<span class="mag-r-5">菜品下单</span><span class="blue f-b">2</span>
												<a href="" class="fr red9 do_it pad-l-15 pad-r-15 center f-13">处理</a>
											</p>
										</div>
										<div class="bank5"></div>
										<div class="list table">
											<dl class="cf">
												<dt class="fl f-b f-15"><span class="red9 pad-r-5">003号</span><span>餐桌客人</span></dt>
												<dd class="fr f-13 grayb8">00:00</dd>
											</dl>
											<p class="mag-t-10 f-15">
												<span class="mag-r-5">菜品下单</span><span class="blue f-b">2</span>
												<a href="" class="fr red9 do_it pad-l-15 pad-r-15 center f-13">处理</a>
											</p>
										</div>
										<div class="bank5"></div>

										<div class="list pay">
											<dl class="cf">
												<dt class="fl f-b f-15">
											<img src="../images/w/img.png" class="icon_img mag-r-5"/><span>张三</span>
										</dt>
												<dd class="fr grayb8 f-13">
													<span class="mag-r-5">2018.12.12</span><span>14:12:56</span>
												</dd>
											</dl>
											<p class="mag-t-5 f-15">
												<span class=" mag-r-10">收到微信支付</span><span class="blue f-b">￥32.3</span>
												<a href="" class="fr red9 do_it pad-l-15 pad-r-15 center f-13">处理</a>
											</p>
										</div>
									</div>

									<!--下拉按钮部分-->
									<div class="center mag-t-15 pad-b-15">
										<a href="workRecord.html" class="pad-t-5 pad-b-5 bk pad-l-100 pad-r-100 bg-fff red9 more_info">
											<span>3</span><span>条未处理</span>
										</a>
									</div>
								</div>

								<!--无消息时-->
								<div v-if="msg" class="no_info">
									<div class="f-15 center pad-t-80 pad-b-60 bg-fff">
										<p class="bg"></p>
										<p class="mag-t-20">{{b_lg[1216]}}</p>
									</div>
									<div class="bank15"></div>
								</div>
							</div>

						</div>
						<div class="bank10"></div>
						<!--菜谱部分-->
						<div class="bottom center">

							<!--收款码部分-->
							<div class="cf bg-fff pay_code">
								<div class="fl my_table">
									<a href="javascript:;" @click="cli_jum">
										<dl v-if="msg" class="fiex pad-t-30 pad-b-30">
											<dt class="col-sm-6 cf pad-l-45">
									<div class="fl"><img src="../images/w/opt_04.png" class="pr"/></div>
									<div class="oh pad-l-5 pad-r-5">
										<p class="f-15 c000">{{b_lg[1217]}}</p>
										<p class="f-13 c999">{{b_lg[1218]}}/{{b_lg[1219]}}</p>
									</div>
								</dt>
											<dd class="fiex1 f-left col-sm-6 cf">
												<div class="fl center col-sm-6">
													<p class="red9">{{home_smg.shop_table_used_count}}</p>
													<p class="f-13">{{b_lg[1220]}}</p>
												</div>
												<div class="center oh">
													<p class="c999">{{home_smg.shop_table_null_count}}</p>
													<p class="f-13">{{b_lg[1221]}}</p>
												</div>
											</dd>

										</dl>
									</a>
								</div>

								<!--<div class="item fl line">
									<a @click="jum('shopCode.html')">
										<p class="top"><img src="../images/w/opt_01.png" /></p>
										<p class="mag-t-15 text f-15">{{b_lg[1222]}}</p>
									</a>
								</div>-->
								<!--收款记录-->
								<!--<div class="item fl">
									<a href="collectionRecord.html">
										<p class="red9 top f-18">0.00</p>
										<p class="mag-t-15 text f-15">{{b_lg[1223]}}</p>
									</a>
								</div>-->
								<div class="item fl">
									<a @click="jum('../coupon/discountCoupon.html')">
										<p class="red9 top f-18">{{home_smg.coupon_uesd_count}}</p>
										<p class="mag-t-15 text f-15">{{b_lg[1224]}}</p>
									</a>
								</div>
								<div class="item fl">
									<a @click="jum('../vip/vipCardSearch.html')">
										<p class="red9 top f-18">{{home_smg.coupon_uesd_count}}</p>
										<p class="mag-t-15 text f-15">会员卡</p>
									</a>
								</div>

								<!--<div class="item fl line">
							<a href="systemMessages.html">
								<p class="pr top">
									<img src="../images/w/opt_03.png" />
									<span class="bg-red9 fff pa point f-12">3</span>
								</p>
								<p class="mag-t-15 text f-15">系统消息</p>
							</a>
						</div>-->
								<div class="item fl line">
									<a @click="jum('../shop/attendanceRecord.html')">
										<p class="top"><img src="../images/w/opt_02.png" /></p>
										<p class="mag-t-15 text f-15">{{b_lg[1225]}}</p>
									</a>
								</div>
								<!--<div class="item fl">
									<a @click="jum('workRecord.html')">
										<p class="top pr">
											<img src="../images/w/opt_05.png" alt="" />
											<span class="bg-red9 fff pa point f-12">3</span>
										</p>
										<p class="mag-t-15 text f-15">{{b_lg[1226]}}</p>
									</a>
								</div>-->
							</div>

							<div class="bank10"></div>

							<!--广告栏部分-->
							<div class=" pad-10 bg-fff mag-b-80">

								<div class="ad">

								</div>
							</div>

						</div>
						<!--扫码部分-->
						<footer class="cf bg-fff pad-t-5 pad-b-5 f-9 center">
							<div @click="word_btn" class="fl active switch">
								<a href="javascript:;">
									<p><i class="iconfont icon-gongwenbao f-20"></i></p>
									<p>{{b_lg[1212]}}</p>
								</a>
							</div>
							<div class="fl center switch">
								<div class="code">
									<a class="bk"></a>
								</div>
							</div>
							<div @click="admin_btn" class="fl switch  ccc">
								<a href="javascript:;" class="ccc">
									<p><i class="iconfont icon-shezhi f-20"></i></p>
									<p>{{b_lg[1061]}}</p>
								</a>
							</div>
						</footer>
					</div>
				</div>
				<div v-else class="wrap_body  bg-grayf4 manage">
					<div class="main pad-t-25">
						<div class="center fff">
							<p>
								<img :src="oss+my_msg.headimgurl_path" class="icon" v-if="my_msg.headimgurl_path!=''" />
								<img :src="con_img" class="icon" onerror="lod(this)" v-else/>
							</p>
							<p class="mag-t-10 f-20 f-b">{{my_msg.nickname}}</p>
						</div>
						<div class="mag-t-70">
							<div @click="pag_j('../manage/accountSetting.html')" class="item bg-fff">
								<a href="javascript:;">
									<dl class="pad-l-25 pad-r-25 pad-t-20 pad-b-20 cf">
										<dt class="col-sm-9 f-15">
									<div class="bg bg_01 fl mag-r-20"></div>
									<div>{{b_lg[1209]}}</div>
								</dt>
										<dd class="fr mag-t-5">
											<a href="javascript:;" class=" bg_r bk"></a>
										</dd>
									</dl>
								</a>
							</div>
							<div class="bank5"></div>

							<div @click="pag_j('../shop/myShop.html')" class="item bg-fff">
								<a href="javascript:;">
									<dl class="pad-l-25 pad-r-25 pad-t-20 pad-b-20 cf">
										<dt class="col-sm-9 f-15">
									<div class="bg bg_02 fl mag-r-20"></div>
									<div>{{b_lg[1210]}}</div>
								</dt>
										<dd class="fr mag-t-5">
											<a href="javascript:;" class=" bg_r bk"></a>
										</dd>
									</dl>
								</a>
							</div>
							<div class="bank5"></div>

							<!--<div class="item bg-fff">
								<a @click="pag_j('openVoice.html')" href="javascript:;">
									<dl class="pad-l-25 pad-r-25 pad-t-20 pad-b-20 cf">
										<dt class="col-sm-9 f-15">
									<div class="bg bg_03 fl mag-r-20"></div>
									<div>{{b_lg[1211]}}</div>
								</dt>
									</dl>
								</a>
								<div style="float: right; margin-top: -50px; margin-right: 25px;">
									<div class="onoffswitch">
										<input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>
										<label class="onoffswitch-label" for="myonoffswitch">
         		 						<span class="onoffswitch-inner"></span>
        		 						<span class="onoffswitch-switch"></span>
     	  								</label>
									</div>
								</div>
							</div>-->
							<!--<div class="bank5"></div>-->
							<!--语音-->
							<div class="item bg-fff">
								<a href="javascript:jum('../manage/languageSetting.html');">
									<dl class="pad-l-25 pad-r-25 pad-t-20 pad-b-20 cf">
										<dt class="col-sm-8 f-15">
									<div class="bg bg_04 fl mag-r-20"></div>
									<div>{{b_lg[1073]}}</div>
								</dt>
										<dd class="fr c666">{{lag}}
											<a href="javascript:jum('../manage/languageSetting.html');" class="fr bg_r mag-t-5 mag-l-5 bk"></a>
										</dd>
									</dl>
								</a>
							</div>
							<div class="bank5"></div>
							<!--清除缓存-->
							<div class="item bg-fff">
								<a @click="jum()">
									<dl class="pad-l-25 pad-r-25 pad-t-20 pad-b-20 cf">
										<dt class="col-sm-8 f-15">
											<div class="bg bg_05 fl mag-r-20"></div>
											<div>清除缓存</div>
										</dt>
										<dd class="fr c666">
											<a class="fr bg_r mag-t-5 mag-l-5 bk"></a>
										</dd>
									</dl>
								</a>
							</div>
							<div class="bank5"></div>
							<!--关于我们-->
							<div class="item bg-fff">
								<a @click="jum('../manage/aboutUs.html')">
									<dl class="pad-l-25 pad-r-25 pad-t-20 pad-b-20 cf">
										<dt class="col-sm-9 f-15">
											<div class="bg bg_06 fl mag-r-20"></div>
											<div>关于我们</div>
										</dt>
										<dd class="fr c666">
											<a class="fr bg_r mag-t-5 mag-l-5 bk"></a>
										</dd>
									</dl>
								</a>
							</div>
							<div class="bank5"></div>
							<!--意见反馈-->
							<div class="item bg-fff">
								<a @click="jum('../manage/feedback.html')">
									<dl class="pad-l-25 pad-r-25 pad-t-20 pad-b-20 cf">
										<dt class="col-sm-9 f-15">
											<div class="bg bg_07 fl mag-r-20"></div>
											<div>意见反馈</div>
										</dt>
										<dd class="fr c666">
											<a class="fr bg_r mag-t-5 mag-l-5 bk"></a>
										</dd>
									</dl>
								</a>
							</div>
							<div class="bank5"></div>
						</div>
						<p class="center mag-t-25">
							<a href="javascript:;" @click="ext_log()" class="bg-red9 fff pad-l-55 pad-r-55 pad-t-15 pad-b-15 btn mag-t-15">{{b_lg[1213]}}</a>
						</p>

						<div class="bank100"></div>

					</div>
					<footer class="cf bg-fff pad-t-5 pad-b-5 f-9 center">
						<div @click="word_btn" class="fl active switch">
							<a href="javascript:;" class="ccc">
								<p><i class="iconfont icon-gongwenbao f-20"></i></p>
								<p>{{b_lg[1212]}}</p>
							</a>
						</div>
						<div class="fl center switch">
							<div class="code">
								<a class="bk" href="javascript:jum('../qrcode/qrscan.html?type=4');"></a>
							</div>
						</div>
						<div @click="admin_btn" class="fl switch  ccc">
							<a href="javascript:;">
								<p><i class="iconfont icon-shezhi f-20"></i></p>
								<p>{{b_lg[1061]}}</p>
							</a>
						</div>
					</footer>
				</div>
			</div>
			<!--接口未加载完成界面-->
			<div v-else>
				<div class="mask bg-000 pa loading">
					<div class="pad-l-40 pad-r-40 pad-t-200">
						<div class="bg-fff wrap pr center ">
							<img src="../images/default_graph/animation.gif" />
						</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			console.log("uuid", phone_uuid);
			//检测登陆状态
			var app = null

			function refresh() {
				app.init()
			}
            function admin_btn() {
            	app.init()
            	setTimeout(function(){
            		app.admin_btn()
            	},300)
			}
			function fun1() {
				var int;
				var log = getItem("login_sta")
				if(log != "1") {
					clicked("../login/login.html")
				}
				app = new Vue({
					el: '#app',
					data: {
						url: con_img, //默认图片
						my_msg: {},
						work_time: '00:00:00', //工作时间
						ret_data: {},
						c_time: "", //员工打卡时间
						home_smg: "",
						now_time: "", //系统当前时间
						b_lg: global_lange, //语言包
						headimgurl_path: con_img, //默认图片
						my_name: "", //昵称
						lag: global_lange_config[getItem('lg')].name, //已经选择的语言
						cla: "work",
						wind_work: "2",
						clock_v: false, //接口是否加载完成
						msg: false //消息 开桌是否显示
					},
					mounted: function() {
						this.init();
					},
					methods: {
						cli_jum: function() { //点击跳转提前缓存菜谱
							jum("tableStatus.html");
						},
						ext_log: function() {
							//退出登录清除重置状态
							setItem("login_sta", "0");
							//跳转到登陆页面
							global_signout(); //退出登录
							if(navigator.userAgent.match(/Html5Plus/i)) {
								plus.runtime.restart() //重启app
							} else {
								clicked("../work/workbench.html")
							}

						},
						//管理按钮
						admin_btn: function() {
							this.wind_work = 0
							this.init_admin()
						},
						//工作台按钮
						word_btn: function() {
							if(app.home_smg.check_work.status == 1) //获取服务员工作状态
							{
								this.wind_work = 1;
							}
							//							this.wind_work = 1;
							//							
						},
						//页面跳转
						pag_j: function(h) {
							jum(h);
						},
						init: function() { //工作台界面
							var login = getItem("login_sta")
							if(login != 1) {
								jum("../login/login.html")
							}
							//语言包
							this.b_lg = JSON.parse(getItem("Langues"))
							this.lag = global_lange_config[getItem('lg')].name

							//获取服务员信息(头像...)
							common_ajax("1", {}, "get_waiter_info", function(h) {
								app.my_msg = h.result;
								//获取当前店铺信息
								common_ajax("1", {}, "get_home", function(h) {
									if(h.result.shop_from == 2) {
										app.msg = false
									} else {
										app.msg = true
									}

									if(h.result.check_work == "" || h.result.check_work == undefined || h.result.check_work == 0) {
										jum("../shop/myShop.html");
										app.clock_v = true;
										return
									}
									app.home_smg = h.result;
									if(!app.home_smg.shop_table_used_count) {
										app.home_smg.shop_table_used_count = 0
									}

									if(h.result.check_work.status == 1) {
										app.c_time = h.result.check_work.addtime
										app.word_btn()
									} else {
										app.admin_btn()
									}
									app.now_time = h.result.time;

									app.work_time = ti(app.c_time);
									app.clock_v = true; //将加载动画关闭
									setInterval(function() {
										app.work_time = ti(app.c_time);
									}, 60000);
								});
							});
						},
						init_admin: function() { //管理界面加载数据
							this.my_msg = JSON.parse(getItem("my_msg"));
							this.headimgurl_path = oss + this.my_msg.headimgurl_path;
							this.my_name = this.my_msg.nickname;
						},
						work_time: function() { //计算工作时间
							setInterval(function() {
								app.work_time = ti(app.c_time);
							}, 60000);
						}

					}
				})
				//取得时间
				function ti(car_time) { //打卡时候的时间
					//					var unixTimestamp = new Date((app.now_time - car_time) * 1000);

					var sec_to_time = function(s) {
						var t;
						if(s > -1) {
							var hour = Math.floor(s / 3600);
							var min = Math.floor(s / 60) % 60;
							if(hour < 10) {
								t = '0' + hour + ":";
							} else {
								t = hour + ":";
							}
							if(min < 10) {
								t += "0";
							}
							t += min;
						}
						return t;
					}
					var s = app.now_time - car_time
					return sec_to_time(s);
				}
				//执行一次
				if(navigator.userAgent.match(/Html5Plus/i)) {
					setItem("uuid", plus.device.uuid)
					var info = plus.push.getClientInfo()
					setItem("gpush_clientid", info.clientid)
					setItem("gpush_token", info.token)
				} else {
					phone_uuid = "866982030752101,866982030752119"; //pc虚拟一个uuid方便测试
					setItem("uuid", phone_uuid)
				}
			}
		</script>
	</body>

</html>